package cn.tedu.sp04.order.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import sp01.pojo.Item;
import sp01.pojo.Order;
import sp01.service.OrderService;

import java.util.Arrays;

@Slf4j
@Service
public class OrderServiceImpl implements OrderService {

    @Override
    public Order getOrder(String orderId) {
        Order order=new Order();
        order.setId(orderId);
        order.setItems(Arrays.asList(new Item[]{
                new Item(1,"aaa",2),
                new Item(2,"bbb",1),
                new Item(3,"ccc",1),
                new Item(4,"ddd",3),
                new Item(5,"eee",5),
        }));
        return order;
    }

    @Override
    public void addOrder(Order order) {
        log.info("订单保存"+order);
    }
}
